<?php
    $this->layout('base.phtml', [
        'title' => _('Account validation'),
        'canonical' => url_full('new account validation'),
        'current_page' => 'account validation',
        'back_options' => [
            'track' => false,
        ],
        'has_errors' => $form->isInvalid(),
    ]);
?>

<div class="section">
    <div class="section__title">
        <h1><?= _('Account validation') ?></h1>
    </div>

    <p class="section__intro">
        <?= _f('You’re about to validate your account on %s. Please click the button below to confirm.', get_app_configuration('brand')) ?>
    </p>

    <form method="post" action="<?= url('create account validation') ?>">
        <?php if ($form->isInvalid('@base')): ?>
            <?= $this->include('alerts/_error.phtml', ['message' => $form->error('@base')]) ?>

            <div class="text--center">
                <a class="anchor--action" href="<?= url('account validation') ?>">
                    <?= _('Back to the account validation') ?>
                </a>
            </div>
        <?php else: ?>
            <div class="text--center">
                <button class="button--primary" type="submit">
                    <?= _('Confirm my account') ?>
                </button>
            </div>

            <input type="hidden" name="csrf_token" value="<?= csrf_token($form) ?>" />
            <input type="hidden" name="t" value="<?= protect($form->t) ?>" />
        <?php endif; ?>
    </form>

    <img
        class="illustration illustration--centered"
        alt=""
        src="<?= url_static('illustrations/contact.svg') ?>"
        height="250"
    />
</div>
